<link rel="stylesheet" type="text/css" href="/lib/front/main.css">
<link rel="stylesheet" type="text/css" href="/lib/front/reset.css">
<script type="text/javascript" src="/lib/js/jquery.min.js"></script>
<div class="headerBar">
  <div class="logoBar login_logo">
    <div class="comWidth">
      <div class="logo fl" style="position:relative;z-index: 3;">
        <a href="#"><img style="width:200px;" src="./img/login.jpg" alt="sky"></a>
      </div>
      <h3 class="welcome_title">欢迎登陆我的书城</h3>
    </div>
  </div>
</div>

<div class="loginBox">
  <div class="login_cont">
    <ul class="login" style="margin-top:40px;">
      <li class="l_tit">邮箱/用户名/手机号</li>
      <li class="mb_10"><input type="text" name="name" class="login_input user_icon" id="name"></li>
      <li class="l_tit">密码</li>
      <li class="mb_10"><input type="password" name="password" class="login_input user_icon" id="pass"></li>
      <li class="autoLogin"><input type="checkbox" id="a1" class="checked"><label for="a1">自动登陆</label></li>
      <li><button  class="login_btn" onclick="gologin()">登录</button></li>
      <li><a href="register"><button class="login_btn">注册</button></a></li>
    </ul>
    <div class="login_partners">
      <p class="l_tit">第三方登录</p>
      <ul class="login_list clearfix">
        <li><a href="#">QQ</a></li>
        <li><span>|</span></li>
        <li><a href="#">网易</a></li>
        <li><span>|</span></li>
        <li><a href="#">新浪微博</a></li>
        <li><span>|</span></li>
        <li><a href="#">腾讯微薄</a></li>
        <li><span>|</span></li>
        <li><a href="#">新浪微博</a></li>
        <li><span>|</span></li>
        <li><a href="#">腾讯微薄</a></li>
      </ul>
    </div>
  </div>
</div>

<div class="hr_25"></div>
<div class="footer">
  <p><a href="#">我的书城简介</a><i>|</i><a href="#">公告</a><i>|</i> <a href="#">招纳贤士</a><i>|</i><a href="#">联系我们</a><i>|</i>客服热线：000-6705-1234</p>
  <p>Copyright &copy; 2017 - 2020 sky版权所有&nbsp;&nbsp;&nbsp;京ICP备09037834号&nbsp;&nbsp;&nbsp;京ICP证B1034-8373号&nbsp;&nbsp;&nbsp;某市公安局XX分局备案编号：123456789123</p>
  <p class="web"><a href="#"><img src="img/foot1.png" alt="logo">7天无理由退货</a><a href="#"><img src="img/foot2.png" alt="logo">15天免费换货</a><a href="#"><img src="img/foot3.png" alt="logo">满99包邮</a><a href="#"><img src="img/foot4.png" alt="logo">全心服务</a></p>
</div>
</body>

<script type="text/javascript">
function gologin() {
  var name = $("#name").val();
  var pass = $("#pass").val();
  if(name == "" || undefined){
    alert("账号不能为空！");
    $("#name").focus();
    return false;
  }else if(pass == "" || undefined){
    alert("密码不能为空！");
    $("#pass").focus();
    return false;
  }else{
    $.ajax({
        type: 'POST',
        url: 'gologin',
        dataType: 'json',
        data: {name:name,pass:pass},
        success: function(data){
          if(data){
            window.location="/"; 
          }else{
            alert("账号或密码错误！");
          }
        },
        fail: function(data){
          console.log(data);
        }
    });
  }
}
</script>